﻿using System;
using System.Collections.Generic;
using System.Text;
using static Asion.Dapper.SqlMapperExtensions;

namespace Asion.Dapper.SqlBuilder
{
    public class SimpleCrudSqlBuilderFactory
    {
        public static ISimpleCurdSqlBuilder<TEntity> Create<TEntity>() where TEntity : IEntity
        {
            var name = TenantMananger.GetTenantsName<TEntity>();
            var dbtype = DapperConfiguration.connection_factory.GetDbType(name);
            if (dbtype == DatabaseType.SQLServer)
            {
                //return new SimpleCrudSqlServerBuilder<TEntity>();
            }
            if (dbtype == DatabaseType.MySQL)
            {
                return new SimpleCrudMySqlBuilder<TEntity>();
            }
            throw new NotImplementedException();
        }
    }
}
